package ruru.server.backend;


/**
 * A representation for loot assigned to a raider after dropping a boss in World
 * of Warcraft.
 * 
 * @author zane.tian@gmail.com
 */
public class LootAssignment {
	private Raider raider;
	private BossDrop loot;
	private String bidType;
	private double bidAmount;
	private boolean bidAmountInitialized = false;
	
	public LootAssignment(Raider raider, BossDrop loot, String bidType) {
		this.raider = raider;
		this.loot = loot;
		this.bidType = bidType;
		this.bidAmount = 0;
	}
	
	public void setBidAmount(double d) {
		this.bidAmount = d;
		bidAmountInitialized = true;
	}
	
	public double getBidAmount() {
		if(!bidAmountInitialized)
			throw new IllegalStateException("Cannot get bid amount if it hasn't been initialized");
		return bidAmount;
	}
	
	public String getBidType() {
		return bidType;
	}
	
	public BossDrop getBossDrop() {
		return loot;
	}
	
	public Raider getRaider() {
		return raider; 
	}
}
